import { delToken, getToken, setToken } from '@/utils/storage'
export default {
  state: {
    token: getToken() || ''
  },
  mutations: {
    // 设置存储token到仓库
    setToken (state, token) {
      state.token = token // 存储到vuex
      setToken(token)// 存储到本地
    },
    loutToken (state, token) {
      // 移除vuex里的token
      state.token = ''
      // 移除本地的token
      delToken()
    }
  },
  actives: {},
  getters: {},
  namespaced: true
}
